package com.yc.springboot.controller;


import com.yc.springboot.bean.Bank;
import com.yc.springboot.bean.Person;
import com.yc.springboot.mapper.BankMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

import javax.annotation.Resource;
import javax.websocket.server.ServerEndpointConfig;

@Slf4j  //自动生成一个log对象
@RestController
public class UserController {

    @Resource
    Person person;

    @RequestMapping("/a")
    public Person a(){
        log.info("测试日志");
//        log.error("错误日志");
        return person;
    }

    @Resource
    BankMapper bankMapper;

    @GetMapping("queryAccount")
    public Bank queryAccount(Integer id){
        return bankMapper.getById(id);
    }


}
